
var imgarr = new Array('banner01.jpg','banner02.jpg','banner03.jpg');
	var k = 0;
	var color = '#0318C1';
	var spcolor = '#96C';
	function change(){
		document.getElementById('img').src = 'images/u/'+imgarr[k];
		chNum();
	}
	function chNum(){
		var span = document.getElementById('num').getElementsByTagName('span');
		var len = span.length;
		for(var i = 0;i<len;i++){
		span[i].style.backgroundColor = color;
		}
		span[k].style.backgroundColor = spcolor;	
	}
	
	function run(){
		k++;
		(k == imgarr.length) && (k = 0);
		change();
	}
	var timer = window.setInterval('run()',4000);
	function stop(){
		window.clearInterval(timer);
	}
	function started(){
		timer = window.setInterval('run()',4000);
	}

	function stoped(num){
		window.clearInterval(timer);
		k = num-1;
		change();
	}


//使用div时，请保证colee_left2与colee_left1是在同一行上.
var speed=30//速度数值越大速度越慢
var colee_left2=document.getElementById("colee_left2");
var colee_left1=document.getElementById("colee_left1");
var colee_left=document.getElementById("colee_left");
colee_left2.innerHTML=colee_left1.innerHTML
function Marquee3(){
if(colee_left2.offsetWidth-colee_left.scrollLeft<=0)//offsetWidth 是对象的可见宽度
colee_left.scrollLeft-=colee_left1.offsetWidth//scrollWidth 是对象的实际内容的宽，不包边线宽度
else{
colee_left.scrollLeft++
}
}
var MyMar3=setInterval(Marquee3,speed)
colee_left.onmouseover=function() {clearInterval(MyMar3)}
colee_left.onmouseout=function() {MyMar3=setInterval(Marquee3,speed)}


;(function(){
	var i=0;
	var $=function(ID){return document.getElementById(ID);};
	var timer=null,speed=1000;
	$("img2").getElementsByTagName("li")[0].style.display="block";
	;(function(){
 		if(i>=$("img2").getElementsByTagName("li").length){
  			for(var j=0;j<$("img2").getElementsByTagName("li").length;j++){
  				$("img2").getElementsByTagName("li")[j].style.display="none";
  			}
  			i=1;
  			$("img2").getElementsByTagName("li")[0].style.display="block";
  		} else {
  			for(var j=0;j<$("img2").getElementsByTagName("li").length;j++){
  				//console.log(j+""+i);
  				if(j===i){
  					$("img2").getElementsByTagName("li")[j].style.display="block";
  				} else {
  					$("img2").getElementsByTagName("li")[j].style.display="none";
  				}
  			}
  			i++;
  		}
  		timer=setTimeout(arguments.callee,speed);
	})();
})();